<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <title>Penguin System</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />

    <link href="<c:url value='/js/bootstrap/assets/css/bootstrap.css'/> " rel="stylesheet">
    <link href="<c:url value='/js/bootstrap/assets/css/bootstrap-responsive.css'/> " rel="stylesheet">
    <script src="<c:url value='/js/bootstrap/assets/js/bootstrap.js'/>"></script>
    <script src="<c:url value='/js/bootstrap/assets/js/jquery.js'/>"></script>
     <script type="text/javascript" src="<c:url value='/js/jquery/jquery-1.4.2.min.js'/> "></script>
    <style>
        body {
            padding-top: 60px;
            position: relative;
        }
        #table-header {
            border-bottom: 1px solid gray;
        }
        table {
            font-size: 12px;
            margin-left: 300px;
        }
        td {
            text-align: center;
            width: 100px;
            padding-top: 5px;
            padding-bottom: 5px;
        }
        th {
            text-align: center;
            width: 100px;
            font-size: 22px;
        }
        .label {
            width: 160px;
            text-align: left
        }
        .odd {
            background-color: #EEEEEE
        }
        .modified {
            background-color: red;
        }
        .error {
            color: red;
        }
        input {
            padding: 2px;
            font-size: 100%
        }
    </style>
</head>
<script>

            function rebuildIndex(){
                var indexVal = $("#filePath").val();
                $.post("${root}/penguin/index/all",{"filePath":indexVal},function(data){
                    if(data!='err'){
                        data = "<p class='text-success'>成功重建索引，花费 "+data+" ms时间</p>";
                         $("#result").html(data);
                    }else{
                        $("#result").html("重建数据索引失败，可能网络出现问题");
                    }

                })
            }

        </script>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
  <div class="navbar-inner">
    <div class="container">
      <a class="brand" href="/penguin/index">
        Penguin
      </a>
      <ul class="nav">
        <li>
          <a href="/penguin/index">
            Home
          </a>
        </li>
        <li>
          <a href="/penguin/index">
            关键字列表
          </a>
        </li>
        <li class="active">
          <a href="/penguin/index/manager">
            索引管理
          </a>
        </li>
      </ul>
    </div>
  </div>
</div>

<div id="info">
    <form class="form-horizontal">
        <div class="control-group">
            <label class="control-label" >数据文件路径：</label>
            <div class="controls">
                <input class="input-xxlarge" id="filePath" name="filePath" type="text" />
            </div>
        </div>
        <div class="control-group">
            <div class="control-label">
                <input class="btn btn-primary" type="button" value="重建数据索引" onclick="rebuildIndex()"/>
            </div>
        </div>

        <div id='result'style="padding-left:50px;"></div>
    </form>
</div>
</body>
</html>